import request from '@/utils/axios-request.js'

const PERMISSION_BASE_URL = "/api/v1/setting/permission";


const SettingPermissionAPI = {
    getList() {
        return request({
            url: `${PERMISSION_BASE_URL}`,
            method: 'GET',
        })
    },
    getAllKeys() {
        return request({
            url: `${PERMISSION_BASE_URL}/keys`,
            method: 'GET',
        })
    },
    add(data) {
        return request({
            url: `${PERMISSION_BASE_URL}`,
            method: 'POST',
            data
        })
    },
    getFormData(id) {
        return request({
            url: `${PERMISSION_BASE_URL}/${id}`,
            method: "get",
        });
    },
    update(id, data) {
        return request({
            url: `${PERMISSION_BASE_URL}/${id}`,
            method: 'put',
            data
        })
    },
    refresh() {
        return request({
            url: `${PERMISSION_BASE_URL}/refresh`,
            method: 'put'
        })
    }
}

export default SettingPermissionAPI